package com.edcarlos.servico.bean;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.widget.ImageButton;
import android.widget.Toast;
import android.view.View.OnClickListener;

public class MenuPrincipalActivity extends Activity {

	ImageButton bntimage;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_menu_principal);
		Log.i("teste", "oncreate");
	btnListar_click();
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.menu_principal, menu);
		return true;
	}

	 private void btnListar_click(){
		 Log.i("teste", "bnt");
		 bntimage = (ImageButton) findViewById(R.id.imgBtnTipo);
		 bntimage.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Log.i("teste", "onclick");
				 Intent intent = new Intent();
				 intent.setClass(MenuPrincipalActivity.this, ListarTipoActivity.class);
				 startActivity(intent);
				
			}
		});
		
	 }
	 
	 public void onClick(View view) {
		Log.i("teste", "tteste");
	        switch (view.getId()) {
	        case R.id.imgBtnTipo:
	        	Log.i("teste", "tteste "+ view.getId());
	        	 Intent intent = new Intent();
				 intent.setClass(MenuPrincipalActivity.this, ListarTipoActivity.class);
				 startActivity(intent);
	            break;
	        }
	    }
	 
}
